package com.yiban.demo.Global.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/System")
public class SystemController {
    @Autowired
    private ApplicationContext applicationContext;
    @GetMapping("/shutdown")
    public void shutdown(){
        ((ConfigurableApplicationContext) applicationContext)
                .close();
    }
}
